* PROJECT: "What Leads Racially Resentful Voters to Choose Black Candidates?" for The Journal of Politics
** TASK: Replicate observational results

********************************************************************************
* READ ME *
** Please make sure you change the working directory below and that your folder
** has a subfolder entitled "Tables"
********************************************************************************


clear all
set more off


** SET DIRECTORY
*	if c(username)== "YOUR_USERNAME_HERE" {
*		cd "YOUR/DIRECTORY/HERE"
*		global slash /
*	}

*	else {
*	display "SET DIRECTORY"
		
*	}
	
********************************************************************************

use "Observation_final.dta", clear

set scheme s1mono

********************************************************************************
**************************** PAPER TABLE AND FIGURE ****************************
********************************************************************************

*******
* Numbers in text on page 10 are drawn from the analyses below
*******	
	** Numbers of white respondents who reported participating in the congressional election
		sort year
		by year: tab year
	
	** Number of self-reported voters in districts with candidates' party identities and race
		sort year
		by year: fre bdwr
		
	** Chronbach's alpha
		alpha rr1 rr2 if year == 2010
		alpha rr1 rr2 if year == 2012
		alpha rr1 rr2 if year == 2014


*******
* TABLE 1 - Determinants of Vote for Black Candidate, 2010-2014 CCES Common Content All Election Years Combined (p. 12)
*******
	** Null Model
		probit voteblack c.rrindex dem gop ideo age male educ faminc i.year, cluster(stcd) 
	** Basic Model
		probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc i.year, cluster(stcd) 
	** District Controls
		probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc i.stcd i.year, r 
	** Valid. Vote
		probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc i.year if validvote==1, cluster(stcd) 

		
*******
* Numbers in text on page 13 are drawn from the analyses below
*******	
	** Moving from 10th to 90th percentile of racial resentment for the predicted probability of voting for the black candidate
		probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc i.year, cluster(stcd) 
		margins, at(rrindex=(.296 .962) wdbr=(0 1))

	** Marginal	effect of racial resentment (three elections analyzed separately) 
		probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc if year==2010 & validvote==1, cluster(stcd) 
		margins wdbr, dydx(rrindex)

		probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc if year==2012 & validvote==1, cluster(stcd) 
		margins wdbr, dydx(rrindex)

		probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc if year==2014 & validvote==1, cluster(stcd) 
		margins wdbr, dydx(rrindex)

	** Marginal	effect of racial resentment (three elections analyzed together) 
		probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc i.year if validvote==1, cluster(stcd) 
		margins wdbr, dydx(rrindex)
	
	
*******
* Numbers in footnote 9 on pages 13 and 14 are drawn from the analyses below
*******	
	**  Create a dummy variable for being below the median in racial resentment by year
	egen rrindex_med_2010=median(rrindex) if year==2010
	egen rrindex_med_2012=median(rrindex) if year==2012
	egen rrindex_med_2014=median(rrindex) if year==2014

	gen rrindex_hi=0
	replace rrindex_hi=1 if rrindex>rrindex_med_2010 & year==2010
	replace rrindex_hi=1 if rrindex>rrindex_med_2012 & year==2012
	replace rrindex_hi=1 if rrindex>rrindex_med_2014 & year==2014

	tab voteblack rrindex_hi if wdbr==1 & year==2010 & gop==1, col
	
	
	
*******
* FIGURE 1 - Racial Resentment and Probability of Voting for Black Candidates, 2010–2014 All Election Years Combined (p. 14)
*******
	** (a) All Respondents
		probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc i.year, cluster(stcd) 
		margins wdbr, at(rrindex=(0(.1)1))
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)
	
	** (b) Independents
		probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if indep==1, cluster(stcd)
		margins wdbr, at(rrindex=(0(.1)1))
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

	** (c) Republicans
		probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if gop==1, cluster(stcd)
		margins wdbr, at(rrindex=(0(.1)1))
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

	** (d) Democrats
		probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if dem==1, cluster(stcd)
		margins wdbr, at(rrindex=(0(.1)1))
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)
		
*******
* P-Value in footnote 8 on page 11 is drawn from the analyses below
*******	
	** Test to ensure that results are not dependent on any one congressional candidate
		** Generate values for each black Republican candidate
			gen cand_num=.
			replace cand_num=1 if stcd==309
			replace cand_num=2 if stcd==506
			replace cand_num=3 if stcd==607
			replace cand_num=4 if stcd==703
			replace cand_num=5 if stcd==918
			replace cand_num=6 if stcd==922
			replace cand_num=7 if stcd==2005
			replace cand_num=8 if stcd==3001
			replace cand_num=9 if stcd==3006
			replace cand_num=10 if stcd==3009
			replace cand_num=11 if stcd==3313
			replace cand_num=12 if stcd==4001
			replace cand_num=13 if stcd==4209
			replace cand_num=14 if stcd==4323
			replace cand_num=15 if stcd==4404
			replace cand_num=16 if stcd==4608
	
		** Test the key interaction
			forvalues k = 1(1)16 {
			 probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc i.year if cand_num~=`k', cluster(stcd) 
			}
		



********************************************************************************
************************** APPENDIX TABLES AND FIGURES **************************
********************************************************************************

*******
* TABLE A1 - Descriptive Statistics for Key Variables (p. 2 of appendix)
*******
	** 2010 CCES Common
		sum rrindex age male educ faminc pid7 gop dem indep ideo5 if year==2010

	** 2012 CCES Common
		sum rrindex age male educ faminc pid7 gop dem indep ideo if year==2012

	** 2014 CCES Common
		sum rrindex age male educ faminc pid7 gop dem indep ideo if year==2014

	
	*** In the CCES datasets, the income categories differ from year to year so the final
	*** value lables in the combined dataset are incorrect. See the CCES codebook for details.

	** Descriptive statistics for 2014 MTurk and CCES experiments of Table A1 are in "ExperimentsAnalysis_JOP.do"
	


*******
* TABLE A2 - Congressional Districts with Black Republican vs. White Democrat (p. 3 of appendix)
*******
	** 2014
		tab stcd wdbr if year==2014
			*** New Jersey 1 stcd = 3001
			*** New Jersey 6 stcd = 3006
			*** New Jersey 9 stcd = 3009
			*** Tennessee 9 stcd = 4209
			*** Texas 23 stcd = 4323
			*** Utah 4 stcd = 4404
			*** Virgina 8 stcd = 4608
			
	** 2012
		tab stcd wdbr if year==2012
			*** Arizona 9 stcd = 309
			*** Connecticut 3 stcd = 703
			*** Florida 18 stcd = 918
			*** South Carolina 1 stcd = 4001  
			*** Utah 4 stcd = 4404
		
	** 2010
		tab stcd wdbr if year==2010
			*** Colorado 7 stcd = 607
			*** Florida 22 stcd = 922
			*** Maryland 5 stcd = 2005
			*** North Carolina 13 stcd = 3313
			*** Tennessee 9 stcd = 4209


*******
* FIGURE A1 - Distribution of Racial Resentment by Dataset (p. 4 of appendix)
*******
	** (a) 2010 CCES Common
		kdensity rrindex if year==2010, bwidth (.2) xlabel (0(.1)1) normal

	** (b) 2012 CCES Common
		kdensity rrindex if year==2012, bwidth (.2) xlabel (0(.1)1) normal

	** (c) 2014 CCES Common
		kdensity rrindex if year==2014, bwidth (.2) xlabel (0(.1)1) normal

	** Panels d, e, and f of Figure A1 are in "ExperimentsAnalysis_JOP.do"
	
*******
* TABLE A3 - Determinants of Vote for Black Candidate, 2010-2014 CCES Common Content, All Years Combined with Controls for Incumbency and Candidate Quality (p. 6 of appendix)
*******
	probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc white_incumbent black_incumbent i.year, cluster(stcd) 
	*outreg2 using "Tables/Table A3", replace dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, No)
	probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc white_incumbent black_incumbent white_qchallenge black_qchallenge i.year, cluster(stcd) 
	*outreg2 using "Tables/Table A3", append tex(frag) dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, No)


*******
* TABLE A4 - Determinants of Vote for Black Candidate, 2010-2014 CCES Common Content (p. 7 of appendix)
*******
	** 2010
		*** Null Model (1)
			probit voteblack c.rrindex dem gop ideo age male educ faminc if year==2010, cluster(stcd) 
			*outreg2 using "Tables/Table A4", replace dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, No)
		*** Basic Model (2)
			probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc if year==2010, cluster(stcd) 
			*outreg2 using "Tables/Table A4", append dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, No)

		*** District Controls (3)
			probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc i.stcd if year==2010, r 
			*outreg2 using "Tables/Table A4", append dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, Yes)

		*** Valid. Vote (4)
			probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc if year==2010 & validvote==1, cluster(stcd) 
			*outreg2 using "Tables/Table A4", append dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, No)

	** 2012
		*** Null Model (1)
			probit voteblack c.rrindex dem gop ideo age male educ faminc if year==2012, cluster(stcd) 
			*outreg2 using "Tables/Table A4", append dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, No)

		*** Basic Model (2)
			probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc if year==2012, cluster(stcd) 
			*outreg2 using "Tables/Table A4", append dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, No)

		*** District Controls (3)
			probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc i.stcd if year==2012, r 
			*outreg2 using "Tables/Table A4", append dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, Yes)

		*** Valid. Vote (4)
			probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc if year==2012 & validvote==1, cluster(stcd) 
			*outreg2 using "Tables/Table A4", append dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, No)

	** 2014
		*** Null Model (1)
			probit voteblack c.rrindex dem gop ideo age male educ faminc if year==2014, cluster(stcd) 
			*outreg2 using "Tables/Table A4", append dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, No)

		*** Basic Model (2)
			probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc if year==2014, cluster(stcd) 
			*outreg2 using "Tables/Table A4", append dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, No)

		*** District Controls (3)
			probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc i.stcd if year==2014, r 
			*outreg2 using "Tables/Table A4", append dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, Yes)

		*** Valid. Vote (4)
			probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc if year==2014 & validvote==1, cluster(stcd) 
			*outreg2 using "Tables/Table A4", append tex(frag) dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, No)

*******
* FIGURE A2 - Racial Resentment and Probability of Voting for Black Candidates, 2010–2014 (p. 8 of appendix)
*******
	** (a) 2010 CCES	
		probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc if year==2010 & validvote==1, cluster(stcd) 
		margins, at(rrindex=(0(.1)1) wdbr=(0 1) )
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

	** (b) 2012 CCES
		probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc if year==2012 & validvote==1, cluster(stcd) 
		margins, at(rrindex=(0(.1)1) wdbr=(0 1) )
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

	** (c) 2014 CCES
		probit voteblack c.rrindex##wdbr dem gop ideo age male educ faminc if year==2014 & validvote==1, cluster(stcd) 
		margins, at(rrindex=(0(.1)1) wdbr=(0 1) )
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

*******
* TABLE A5 - Determinants of Vote for Black Candidate by Respondent Party All Election Years Combined (p. 9 of appendix)
*******
	** Republicans
		probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if gop==1, cluster(stcd)
		*outreg2 using "Tables/Table A5", replace dec(2) e(r2_p ll) addtext(Control for Election Year, Yes)

	** Democrats
		probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if dem==1, cluster(stcd)
		*outreg2 using "Tables/Table A5", append dec(2) e(r2_p ll) addtext(Control for Election Year, Yes)

	** Independents
		probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if indep==1, cluster(stcd)
		*outreg2 using "Tables/Table A5", append tex(frag) dec(2) e(r2_p ll) addtext(Control for Election Year, Yes)

*******
* TABLE A6 - Determinants of Vote for Black Candidate by Respondent Party and Election Year (p. 10 of appendix)
*******
	** 2010 CCES
		*** Republicans
			probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if gop==1 & year==2010, cluster(stcd)
			*outreg2 using "Tables/Table A6 - 2010", replace dec(2) e(r2_p ll) addtext(Control for Election Year, Yes)

		*** Democrats
			probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if dem==1 & year==2010, cluster(stcd)
			*outreg2 using "Tables/Table A6 - 2010", append dec(2) e(r2_p ll) addtext(Control for Election Year, Yes)

		*** Independents
			probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if indep==1 & year==2010, cluster(stcd)
			*outreg2 using "Tables/Table A6 - 2010", append tex(frag) dec(2) e(r2_p ll) addtext(Control for Election Year, Yes)

	** 2012 CCES
		*** Republicans
			probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if gop==1 & year==2012, cluster(stcd)
			*outreg2 using "Tables/Table A6 - 2012", replace dec(2) e(r2_p ll) addtext(Control for Election Year, Yes)

		*** Democrats
			probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if dem==1 & year==2012, cluster(stcd)
			*outreg2 using "Tables/Table A6 - 2012", append dec(2) e(r2_p ll) addtext(Control for Election Year, Yes)

		*** Independents
			probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if indep==1 & year==2012, cluster(stcd)
			*outreg2 using "Tables/Table A6 - 2012", append tex(frag) dec(2) e(r2_p ll) addtext(Control for Election Year, Yes)


	** 2014 CCES
		*** Republicans
			probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if gop==1 & year==2014, cluster(stcd)
			*outreg2 using "Tables/Table A6 - 2014", replace dec(2) e(r2_p ll) addtext(Control for Election Year, Yes)

		*** Democrats
			probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if dem==1 & year==2014, cluster(stcd)
			*outreg2 using "Tables/Table A6 - 2014", append dec(2) e(r2_p ll) addtext(Control for Election Year, Yes)

		*** Independents
			probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if indep==1 & year==2014, cluster(stcd)
			*outreg2 using "Tables/Table A6 - 2014", append tex(frag) dec(2) e(r2_p ll) addtext(Control for Election Year, Yes)


*******
* FIGURE A3 - Racial Resentment and Probability of Voting for Black Candidates from 2010-2014 by Respondent Party (p. 11 of appendix)
*******
	** (a) 2010 Republicans
		probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if gop==1 & year==2010, cluster(stcd)
		margins, at(rrindex=(0(.1)1) wdbr=(0 1) )
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

	** (b) 2010 Democrats
		probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if dem==1 & year==2010, cluster(stcd)
		margins, at(rrindex=(0(.1)1) wdbr=(0 1) )
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

	** (c) 2010 Independents
		probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if indep==1 & year==2010, cluster(stcd)
		margins, at(rrindex=(0(.1)1) wdbr=(0 1) )
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

	** (d) 2012 Republicans
		probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if gop==1 & year==2012, cluster(stcd)
		margins, at(rrindex=(0(.1)1) wdbr=(0 1) )
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

	** (e) 2012 Democrats
		probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if dem==1 & year==2012, cluster(stcd)
		margins, at(rrindex=(0(.1)1) wdbr=(0 1) )
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

	** (f) 2012 Independents
		probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if indep==1 & year==2012, cluster(stcd)
		margins, at(rrindex=(0(.1)1) wdbr=(0 1) )
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

	** (g) 2014 Republicans
		probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if gop==1 & year==2014, cluster(stcd)
		margins, at(rrindex=(0(.1)1) wdbr=(0 1) )
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

	** (h) 2014 Democrats
		probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if dem==1 & year==2014, cluster(stcd)
		margins, at(rrindex=(0(.1)1) wdbr=(0 1) )
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

	** (i) 2014 Independents
		probit voteblack c.rrindex##wdbr age male educ faminc ideo i.year if indep==1 & year==2014, cluster(stcd)
		margins, at(rrindex=(0(.1)1) wdbr=(0 1) )
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

		
****
** Commands for Table A7 immediately follow those of Table A8 below **
****

	
*******
* TABLE A8 - Relationship between Racial Resentment and Respondent Partisanship (p. 14 of appendix)
*******
	** 2010 CCES Common
		ci means rrindex if dem==1 & year==2010 // Democrats
		ci means rrindex if indep==1 & year==2010 // Independents
		ci means rrindex if gop==1 & year==2010 // Republicans
		*** Pairwise Correlation
			pwcorr rrindex pid7 if year==2010, sig
	
	** 2012 CCES Common
		ci means rrindex if dem==1 & year==2012 // Democrats
		ci means rrindex if indep==1 & year==2012 // Independents
		ci means rrindex if gop==1 & year==2012 // Republicans
		*** Pairwise Correlation
			pwcorr rrindex pid7 if year==2012, sig
			
	** 2014 CCES Common
		ci means rrindex if dem==1 & year==2014 // Democrats
		ci means rrindex if indep==1 & year==2014 // Independents
		ci means rrindex if gop==1 & year==2014 // Republicans
		*** Pairwise Correlation
			pwcorr rrindex pid7 if year==2014, sig
	
	** Mean levels of Racial Resentment for 2014 MTurk and CCES experiments of Table A8 are in "ExperimentsAnalysis_JOP.do" 
	

*******
* TABLE A7 - Determinants of Vote for Republican Candidate All Election Years Combined (p. 12 of appendix)
*******
	** This table uses a new dataset 
		use "Observation_whiterep.dta", replace

		probit voterep c.rrindex##i.wdbr dem gop ideo age male educ faminc i.year if wdbr==1|wdwr==1, cluster(stcd) 
		*outreg2 using "Tables/Table A7", replace dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, No)
		probit voterep c.rrindex##i.wdbr ideo age male educ faminc i.year if dem==1 & (wdbr==1|wdwr==1), cluster(stcd) 
		*outreg2 using "Tables/Table A7", append dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, No)
		probit voterep c.rrindex##i.wdbr ideo age male educ faminc i.year if gop==1 & (wdbr==1|wdwr==1), cluster(stcd) 
		*outreg2 using "Tables/Table A7", append dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, No)
		probit voterep c.rrindex##i.wdbr ideo age male educ faminc i.year if indep==1 & (wdbr==1|wdwr==1), cluster(stcd) 
		*outreg2 using "Tables/Table A7", append tex(frag) dec(2) e(r2_p ll) addtext(Control for Election Year, Yes, Control for Congressional District, No)

*******
* FIGURE A4 - Racial Resentment and Probabiliyt of Voting for Republican Candidates by Candidate Race and Respondent Party (p. 13 of appendix)
*******
		probit voterep c.rrindex##i.wdbr dem gop ideo age male educ faminc i.year if wdbr==1|wdwr==1, cluster(stcd) 
		margins wdbr, at(rrindex=(0(.1)1))
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

		probit voterep c.rrindex##i.wdbr ideo age male educ faminc i.year if dem==1 & (wdbr==1|wdwr==1), cluster(stcd) 
		margins wdbr, at(rrindex=(0(.1)1))
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)
	
		probit voterep c.rrindex##i.wdbr ideo age male educ faminc i.year if gop==1 & (wdbr==1|wdwr==1), cluster(stcd) 
		margins wdbr, at(rrindex=(0(.1)1))
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

		probit voterep c.rrindex##i.wdbr ideo age male educ faminc i.year if indep==1 & (wdbr==1|wdwr==1), cluster(stcd) 
		margins wdbr, at(rrindex=(0(.1)1))
		marginsplot, recast(line) recastci(rarea) xlabel(0(.25)1) ylabel(0(.25)1)

